package com.sip.stream.utils.zfy.osd;

import com.gosuncn.zfyluancher.ZFYLauncherJNI;
import com.sip.stream.utils.zfy.config.ZFYOSDConfig;

public class OSDOldTool extends AbstractYUVOSDTool {
    public OSDOldTool(int width, int height, ZFYOSDConfig zFYOSDConfig) {
        super(width, height, zFYOSDConfig);
        TAG = "OSDOldTool";
    }

    @Override
    protected void addOSDToI420Jni(byte[] bArr, OSDBean oSDBean) {
        ZFYLauncherJNI.addOSDToI420HZK(bArr, this.cacheSrcWidth, this.cacheSrcHeight, oSDBean.getOsdData(), oSDBean.getOsdwidth(), oSDBean.getOsdheight(), oSDBean.getStartX(), oSDBean.getStartY(), this.cacheScale);
    }

    @Override
    protected void addOSDToI420ASCII(byte[] bArr, OSDBean oSDBean) {
        int startX = oSDBean.getStartX();
        if (startX < 0) {
            startX = (this.cacheSrcWidth - 15) - ((this.cacheScale * 8) * oSDBean.getOsdData().length);
        }
        ZFYLauncherJNI.addOSDToI420ASCII(bArr, this.cacheSrcWidth, this.cacheSrcHeight, oSDBean.getOsdData(), oSDBean.getOsdData().length, 16, startX, oSDBean.getStartY(), this.cacheScale);
    }
}
